﻿<%@ Page Title="Plan Virtual Flights" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="PlanVirtual.aspx.cs" Inherits="IFD2.PlanVirtual" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <form id="form1" runat="server" role="form" class="form-inline" defaultbutton="lbtnQuery">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate>
    <div class="container-fluid body-content" style="width:100%;">

    <div class="row">
        <div class="col-sm-2 well well-sm">
            <h5><asp:Literal ID="litTitle" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h5>
            <div class="form-group">
                <asp:Label ID="Label1" runat="server" meta:resourcekey="Flight" Text="Flight:"></asp:Label>
                <asp:Label ID="lblAirline" runat="server" Font-Bold="true"></asp:Label>
                <asp:Label ID="lblFltNo" runat="server" Font-Bold="true"></asp:Label><br />
                <asp:Label ID="Label3" runat="server" meta:resourcekey="ID" Text="ID:"></asp:Label>
                <asp:Label ID="lblID" runat="server" Font-Bold="true"></asp:Label>
            </div>
            <br class="hidden-xs"/><br class="hidden-xs"/>
            <asp:LinkButton ID="lbtnQuery" runat="server" CssClass="form-control input-sm btn-primary text-center" Width="100%" ToolTip="" meta:resourcekey="tipQuery" OnClick="lbtnQuery_Click"> <span class="glyphicon glyphicon-search" style="font-size:large;"></span></asp:LinkButton>
            <p></p><%--没有此行(或&nbsp;)，上面的按钮在手机模式(xs)下，只有上半部可以点击！--%>
            <asp:Label ID="lblError" runat="server" CssClass="ifdMessage"></asp:Label>
        </div>

        <div class="col-sm-10 well well-sm">
            <div class="panel">
                <div class="panel-heading btn-primary">
                    <h6 class="panel-title" id="section-2"><asp:Literal ID="Literal1" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h6>
                </div>
                <div class="panel-body">
                    <div class="table-responsive">
                        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                            CellPadding="4" DataSourceID="SqlDataSource1" ForeColor="#333333" style="min-width:500px;width:100%;" class="table-hover"
                            GridLines="None" DataKeyNames="airline,flt_no,id,market_airline">
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <RowStyle BackColor="#EFF3FB" />
                            <Columns>
                                <asp:TemplateField HeaderText=" ">
                                    <ItemTemplate>
                                        <input name="KEY2" type="radio" value='<%# Eval("airline")+"|"+Eval("flt_no")+"|"+Eval("id")+"|"+Eval("market_airline")+"|"+Eval("market_flt_no") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="market_airline" HeaderText="market_airline"  meta:resourcekey="market_airline" ReadOnly="True" SortExpression="market_airline" />
                                <asp:BoundField DataField="market_flt_no" HeaderText="market_flt_no"  meta:resourcekey="market_flt_no" SortExpression="market_flt_no" />
                                <asp:BoundField DataField="done_user" HeaderText="done_user"  meta:resourcekey="done_user" SortExpression="done_user" />
                                <asp:BoundField DataField="done_time" HeaderText="done_time"  meta:resourcekey="done_time" SortExpression="done_time" />
                                <asp:CheckBoxField DataField="authorized" HeaderText="authorized"   meta:resourcekey="authorized1" SortExpression="authorized" />
                                <asp:BoundField DataField="authorizer" HeaderText="authorizer" meta:resourcekey="authorizer1" SortExpression="authorizer" />
                                <asp:BoundField DataField="auth_time" HeaderText="auth_time" meta:resourcekey="auth_time" SortExpression="auth_time" />
                            </Columns>
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <EditRowStyle BackColor="#2461BF" />
                            <AlternatingRowStyle BackColor="White" />
                        </asp:GridView>
                    </div>
                    <asp:Button ID="btnDelete" runat="server" Text="Delete" OnClick="btnDelete_Click"  meta:resourcekey="Delete" CssClass="btn btn-sm btn-default" /><br />
                    <asp:Label ID="Label2" runat="server" CssClass="ifdMessage"></asp:Label>
                    <div class="well well-sm">
                        <div class="form-group">
                        <asp:Label ID="Label4" runat="server" Text="Market Airline:" meta:resourcekey="MarketAirline"></asp:Label>
                        <asp:DropDownList ID="lstAirlines" runat="server" DataSourceID="sqlairlines" DataTextField="code" DataValueField="code">
                        </asp:DropDownList>
                        </div>
                        <div class="form-group">
                        <asp:Label ID="Label5" runat="server" Text="Flight No.:" meta:resourcekey="FlightNo"></asp:Label>
                        <asp:TextBox ID="txtFltNo" runat="server" MaxLength="6" Width="64px"></asp:TextBox>
                        </div>
                        <asp:Button ID="btnAdd" runat="server" CssClass="btn btn-sm btn-default" Text=" Add " OnClick="btnAdd_Click" meta:resourcekey="Add" />
                    </div>
                </div>

                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>" DataSourceMode="DataReader"
                    SelectCommand="bll_plan_get_virtual_flights" SelectCommandType="StoredProcedure">
                    <SelectParameters>
                        <asp:SessionParameter Name="airline" SessionField="AIRLINE" Type="String" />
                        <asp:ControlParameter ControlID="lblFltNo" Name="flt_no" PropertyName="Text" Type="String" />
                        <asp:ControlParameter ControlID="lblID" Name="plan_id" PropertyName="Text" Type="String" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <asp:HiddenField ID="KEY" runat="server" />
                <asp:SqlDataSource ID="sqlairlines" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>"
                    SelectCommand="bll_airline_get_codes" SelectCommandType="StoredProcedure" DataSourceMode="DataReader">
                </asp:SqlDataSource>
            </div>
        </div>
    </div>

    </div>
    </ContentTemplate></asp:UpdatePanel>
    </form>

</asp:Content>
